// import com.alibaba.druid.DbType;
// import com.alibaba.druid.sql.ast.SQLName;
// import com.alibaba.druid.sql.ast.SQLObject;
// import com.alibaba.druid.sql.ast.SQLStatementImpl;
// import com.alibaba.druid.sql.visitor.SQLASTVisitor;

// import java.util.ArrayList;
// import java.util.Collections;
// import java.util.List;

#include "SQLAlterDatabaseStatement.h"
#include "../SQLName.h"
#include "SQLAlterCharacter.h"
#include "../../visitor/SQLASTVisitor.h"

SQLAlterDatabaseStatement::SQLAlterDatabaseStatement()
{
  properties = SQLAssignItem_list_ptr();
}

SQLAlterDatabaseStatement::SQLAlterDatabaseStatement(DbType_ptr  dbType)
{
  this->setDbType(dbType);
}

SQLName_ptr SQLAlterDatabaseStatement::getName()
{
  return name;
}

void SQLAlterDatabaseStatement::setName(SQLName_ptr name)
{
  if (name != nullptr)
  {
    name->setParent(SharedObject(SQLAlterDatabaseStatement));
  }
  this->name = name;
}

std::shared_ptr<SQLAlterCharacter> SQLAlterDatabaseStatement::getCharacter()
{
  return character;
}

void SQLAlterDatabaseStatement::setCharacter(std::shared_ptr<SQLAlterCharacter> character)
{
  if (character != nullptr)
  {
    character->SQLObjectImpl::setParent(SharedObject(SQLAlterDatabaseStatement));
  }
  this->character = character;
}

BOOL_ptr SQLAlterDatabaseStatement::isUpgradeDataDirectoryName()
{
  return upgradeDataDirectoryName;
}

void SQLAlterDatabaseStatement::setUpgradeDataDirectoryName(BOOL_ptr upgradeDataDirectoryName)
{
  this->upgradeDataDirectoryName = upgradeDataDirectoryName;
}

// @Override
void SQLAlterDatabaseStatement::accept0(SQLASTVisitor_ptr visitor)
{
  if (visitor->visit(SharedObject(SQLAlterDatabaseStatement)))
  {
    acceptChild(visitor, name);
  }
  visitor->endVisit(SharedObject(SQLAlterDatabaseStatement));
}

std::shared_ptr<SQLAlterDatabaseItem> SQLAlterDatabaseStatement::getItem()
{
  return item;
}

void SQLAlterDatabaseStatement::setItem(std::shared_ptr<SQLAlterDatabaseItem> item)
{
  this->item = item;
}

SQLAssignItem_list_ptr SQLAlterDatabaseStatement::getProperties()
{
  return properties;
}

// @Override
SQLObject_list_ptr  SQLAlterDatabaseStatement::getChildren()
{
  SQLObject_list_ptr  tmp = SQLObject_list_ptr ();
  tmp->push_back(name);
  return tmp;
}
